SELECT DISTINCT 
    'oracle' as dbms_type_name  
    ,(SELECT instance_name FROM v$instance) as dbms_name  
    ,(SELECT instance_name FROM v$instance) as database_name  
    ,a.owner as table_schema  
    ,a.table_name as table_name  
    ,a.column_name as column_name  
    ,a.column_id as ordinal_position  
    ,NULL as column_default  
    ,0 as is_identity  
    ,case a.NULLABLE when 'Y' then 'YES' else 'NO' end as is_nullable  
    ,a.data_type as data_type  
    ,a.data_length as character_maximum_length  
    ,a.data_length as character_octet_length  
    ,a.data_precision as numeric_precision  
    ,a.data_precision as numeric_precision_radix  
    ,a.data_scale as numeric_scale  
    ,'0' as datetime_precision  
    ,NULL as character_set_catalog  
    ,NULL as character_set_schema  
    ,NULL as character_set_name  
    ,NULL as collation_catalog  
    ,NULL as collation_schema  
    ,NULL as collation_name  
    ,NULL as domain_catalog  
    ,NULL as domain_schema  
    ,NULL as domain_name  
    ,sysdate as load_dtm  
FROM dba_tab_columns a  
WHERE exists (SELECT 'x' FROM dba_tables b                
              WHERE a.owner = b.owner                  
              AND a.table_name = b.table_name                  
              AND b.table_name not like 'BIN$%'                  
              AND b.owner not in ('SYS','SYSTEM','PUBLIC','CTXSYS','DIP','DMSYS','EXFSYS','MDDATA',  'MDSYS','MGMT_VIEW','OLAPSYS','ORACLE_OCM','ORDPLUGINS','ORDSYS','OUTLN','SCOTT','SYSMAN','TSMSYS'  ,'WMSYS','XDB','TOAD','SOE','DBSNMP'))
